import { PropsWithChildren, useEffect } from "react";
import { useDidHide, useDidShow, useLaunch } from "@tarojs/taro";
import "./app.scss";

function App({ children }: PropsWithChildren<any>) {
  useLaunch(() => {
    console.log("App launched 123222.", children);
  });

  // 可以使用所有的 React Hooks
  useEffect(() => {
    console.log("App mounted.");
  });

  // 对应 onShow
  useDidShow(() => {
    console.log("App show.");
  });

  // 对应 onHide
  useDidHide(() => {
    console.log("App hide.");
  });
  // children 是将要会渲染的页面
  return children;
}

export default App;
